//
//  iOSMD5.m
//  DaiXin
//
//  Created by 冉晨阳 on 14/12/25.
//  Copyright (c) 2014年 rcy. All rights reserved.
//

#import "iOSMD5.h"
#import <CommonCrypto/CommonDigest.h>
@implementation iOSMD5

+(NSString *) md5: (NSString *) inPutText
{
    const char *cStr = [inPutText UTF8String];
    unsigned char result[16];
    CC_MD5( cStr, strlen(cStr), result ); // This is the md5 call
    NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2];
    
    for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++)
        [output appendFormat:@"%02x", result[i]];
    
    return  output;
}
@end
